﻿<phone:PhoneApplicationPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
                            xmlns:AccountHelper="clr-namespace:AccountHelper" 
    x:Class="AccountHelper.View.NewChargeView"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"              
    SupportedOrientations="Portrait" Orientation="Portrait"
    d:DesignHeight="696" d:DesignWidth="480"
    DataContext="{Binding NewChargeVM, Source={StaticResource Locator}}"
    shell:SystemTray.IsVisible="True" mc:Ignorable="d">

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/Appbar/appbar.check.rest.png" Text="保存" Click="AppBar_Save"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="Account Helper" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.265*"/>
                    <ColumnDefinition Width="0.735*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="0.111*"/>
                    <RowDefinition Height="0.111*"/>
                    <RowDefinition Height="0.111*"/>
                    <RowDefinition Height="0.311*"/>
                    <RowDefinition Height="0.356*"/>
                </Grid.RowDefinitions>
                <toolkit:DatePicker Grid.Column="1" Grid.Row="0" Value="{Binding DtDate,Mode=TwoWay}" />
                <TextBlock x:Name="tbkChargeDate" Text="日期" 
                           Grid.Row="0" Grid.Column="0" Style="{StaticResource S_NewCharge}"/>
                <TextBlock x:Name="tbkChargeTitle" Text="标题" 
                           Grid.Row="1" Grid.Column="0" Style="{StaticResource S_NewCharge}"/>
                <TextBlock x:Name="tbkType" Text="类型" 
                           Grid.Row="3" Margin="20,12" VerticalAlignment="Top"/>
                <TextBlock x:Name="tbkAmount" Text="金额" 
                           Grid.Row="2" Style="{StaticResource S_NewCharge}"/>
                <toolkit:AutoCompleteBox x:Name="ptbChargeTitle" ItemsSource="{Binding CommonChargeTitles}" Text="{Binding ChargeTitle,Mode=TwoWay}" d:LayoutOverrides="Height, GridBox" Grid.Row="1" Grid.Column="1" InputScope="Default" />
                <toolkit:PhoneTextBox Text="{Binding MAmount,Mode=TwoWay}" x:Name="ptbAmount" Hint="请输入费用的金额" d:LayoutOverrides="Height" Grid.Row="2" Grid.Column="1" InputScope="Number" >
                    <i:Interaction.Behaviors>
                        <AccountHelper:UpdateSourceOnTextChangedBehavior />
                    </i:Interaction.Behaviors>
                </toolkit:PhoneTextBox>
                <toolkit:ListPicker ItemsSource="{Binding ChargeTypes}"  SelectedItem="{Binding SelectType,Mode=TwoWay}" Margin="12,0" d:LayoutOverrides="Height" Grid.Row="3" Grid.Column="1">
                    <toolkit:ListPicker.ItemTemplate>
                        <DataTemplate>
                            <Border BorderThickness="3">
                                <TextBlock  Text="{Binding Key}" FontSize="24"  />
                            </Border>
                        </DataTemplate>
                    </toolkit:ListPicker.ItemTemplate>
                </toolkit:ListPicker>
            </Grid>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>

    